package com.netease.financial.domain.repository;

import com.netease.financial.domain.interactor.RegisterInput;
import com.netease.financial.domain.model.AccessTokenCheck;
import com.netease.financial.domain.model.ActivityPage;
import com.netease.financial.domain.model.AppUpdate;
import com.netease.financial.domain.model.LaunchPage;
import com.netease.financial.domain.model.Login;
import com.netease.financial.domain.model.Logout;
import com.netease.financial.domain.model.PageInfo;
import com.netease.financial.domain.model.Register;
import com.netease.financial.domain.model.UnreadMessageCount;

import java.util.List;

import rx.Observable;

/**
 * Created by wyf on 10/11/15.
 */
public interface NfsRepository {

    /**
     * Get an {@link rx.Observable} which will emit a {@link AppUpdate}.
     *
     * @param versionCode The version code of current installed apk
     */
    Observable<AppUpdate> getAppUpdateInfo(String device, int versionCode);

    /**
     * Get an {@link rx.Observable} which will emit a {@link UnreadMessageCount}.
     *
     * @param accessToken The access token of user account
     */
    Observable<UnreadMessageCount> getUnreadMessageCount(String accessToken);

    /**
     * Get an {@link rx.Observable} which will emit a {@link Login}.
     *
     * @param clientId     The client id of user account
     * @param clientSecret The client secret of user account
     * @param appSecret    The app secret of the app
     */
    Observable<Login> login(String clientId, String clientSecret, String appSecret);

    /**
     * Get an {@link rx.Observable} which will emit a {@link Logout}.
     *
     * @param accessToken The access token of user account
     * @param appSecret   The app secret of the app
     */
    Observable<Logout> logout(String accessToken, String appSecret);

    /**
     * Get an {@link rx.Observable} which will emit a {@link AccessTokenCheck}.
     *
     * @param appSecret   The app secret of the app
     * @param accessToken The access token of user account
     */
    Observable<AccessTokenCheck> checkAccessToken(String accessToken, String appSecret);

    /**
     * Get an {@link rx.Observable} which will emit a {@link ActivityPage}.
     */
    Observable<ActivityPage> getActivityPageInfo();

    /**
     * Get an {@link rx.Observable} which will emit a {@link LaunchPage}.
     *
     * @param widthPixels  The width pixels of current device
     * @param heightPixels The height pixels of current device
     * @param platform     The platform of current device, for example, Android or iOS
     */
    Observable<LaunchPage> getLaunchPageInfo(int widthPixels, int heightPixels, String platform);

    /**
     * Get an {@link rx.Observable} which will emit a {@link Register}.
     *
     */
    Observable<Register> register(RegisterInput registerInput);

    /**
     * Get an {@link rx.Observable} which will emit a {@link LaunchPage}.
     *
     * @param pageName     The name of the page
     * @param elements     The elements that need request, if not set, all elements will be request.
     * @param widthPixels  The width pixels of current device
     * @param heightPixels The height pixels of current device
     * @param platform     The platform of current device, for example, Android or iOS
     */
    Observable<PageInfo> getPageInfo(String pageName, List<String> elements, int widthPixels, int heightPixels, String platform);

}
